package com.wms.function.service.impl;

import java.util.List;
        import com.wms.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wms.function.mapper.TbWarehouseLocationMapper;
import com.wms.function.domain.TbWarehouseLocation;
import com.wms.function.service.ITbWarehouseLocationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.Arrays;

/**
 * 库位设置Service业务层处理
 *
 * @author ruoyi
 * @date 2025-02-26
 */
@Service
public class TbWarehouseLocationServiceImpl extends ServiceImpl<TbWarehouseLocationMapper,TbWarehouseLocation> implements ITbWarehouseLocationService {
    @Autowired
    private TbWarehouseLocationMapper tbWarehouseLocationMapper;

    /**
     * 查询库位设置
     *
     * @param id 库位设置主键
     * @return 库位设置
     */
    @Override
    public TbWarehouseLocation selectTbWarehouseLocationById(Long id) {
                return getById(id);
    }

    /**
     * 查询库位设置列表
     *
     * @param tbWarehouseLocation 库位设置
     * @return 库位设置
     */
    @Override
    public List<TbWarehouseLocation> selectTbWarehouseLocationList(TbWarehouseLocation tbWarehouseLocation) {
        return tbWarehouseLocationMapper.selectTbWarehouseLocationList(tbWarehouseLocation);
    }

    /**
     * 新增库位设置
     *
     * @param tbWarehouseLocation 库位设置
     * @return 结果
     */
    @Override
    public int insertTbWarehouseLocation(TbWarehouseLocation tbWarehouseLocation) {
                                                                return save(tbWarehouseLocation) ? 1 : 0;
    }

    /**
     * 修改库位设置
     *
     * @param tbWarehouseLocation 库位设置
     * @return 结果
     */
    @Override
    public int updateTbWarehouseLocation(TbWarehouseLocation tbWarehouseLocation) {
                                                        return updateById(tbWarehouseLocation) ? 1 : 0;
    }

    /**
     * 批量删除库位设置
     *
     * @param ids 需要删除的库位设置主键
     * @return 结果
     */
    @Override
    public int deleteTbWarehouseLocationByIds(Long[] ids) {
                return removeByIds(Arrays.asList(ids)) ? 1 : 0;
    }

    /**
     * 删除库位设置信息
     *
     * @param id 库位设置主键
     * @return 结果
     */
    @Override
    public int deleteTbWarehouseLocationById(Long id) {
                return removeById(id) ? 1 : 0;
    }

}
